package com.class04.controller;

import com.class04.pojo.Employee;
import com.class04.service.EmployeeService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @ClassDescription:
 * @JdkVersion: 17
 * @Author: yxy
 * @Created: 2023/12/21 19:10
 */
@Controller
@ResponseBody
@RequestMapping("emp")
@Slf4j
public class EmployeeController {
    @Autowired
    private EmployeeService employeeService;

    @GetMapping("find")
    public List<Employee> getList(){
        List<Employee> all = employeeService.findAll();
        log.info("所有员工数据",all.toString());
        return all;

    }
}
